using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._AnalysisTools._PairwiseOverlay
{
    /// <summary>
    /// <para>Pairwise Buffer</para>
    /// <para>Creates buffer polygons around input features to a specified distance using a parallel processing approach.</para>
    /// <para>使用并行处理方法在输入要素周围创建指定距离的缓冲区面。</para>
    /// </summary>    
    [DisplayName("Pairwise Buffer")]
    public class PairwiseBuffer : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public PairwiseBuffer()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_features">
        /// <para>Input Features</para>
        /// <para>The input point, line, or polygon features to be buffered.</para>
        /// <para>要缓冲的输入点、线或面要素。</para>
        /// </param>
        /// <param name="_out_feature_class">
        /// <para>Output Feature Class</para>
        /// <para>The feature class containing the output buffers.</para>
        /// <para>包含输出缓冲区的要素类。</para>
        /// </param>
        /// <param name="_buffer_distance_or_field">
        /// <para>Distance [value or field]</para>
        /// <para><xdoc>
        ///   <para>The distance around the input features that will be buffered. Distances can be provided as either a value representing a linear distance or as a field from the input features that contains the distance to buffer each feature.</para>
        ///   <para>If linear units are not specified or are entered as Unknown, the linear unit of the input features' spatial reference is used.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将缓冲的输入要素周围的距离。距离既可以作为表示线性距离的值提供，也可以作为输入要素的字段提供，其中包含要缓冲每个要素的距离。</para>
        ///   <para>如果未指定线性单位或输入为未知，则使用输入要素空间参考的线性单位。</para>
        /// </xdoc></para>
        /// </param>
        public PairwiseBuffer(object _in_features, object _out_feature_class, object _buffer_distance_or_field)
        {
            this._in_features = _in_features;
            this._out_feature_class = _out_feature_class;
            this._buffer_distance_or_field = _buffer_distance_or_field;
        }
        public override string ToolboxName => "Analysis Tools";

        public override string ToolName => "Pairwise Buffer";

        public override string CallName => "analysis.PairwiseBuffer";

        public override List<string> AcceptEnvironments => ["MDomain", "MResolution", "MTolerance", "XYDomain", "XYResolution", "XYTolerance", "ZDomain", "ZResolution", "ZTolerance", "extent", "geographicTransformations", "outputCoordinateSystem", "outputMFlag", "outputZFlag", "outputZValue", "parallelProcessingFactor", "scratchWorkspace", "workspace"];

        public override object[] ParameterInfo => [_in_features, _out_feature_class, _buffer_distance_or_field, _dissolve_option.GetGPValue(), _dissolve_field, _method.GetGPValue(), _max_deviation];

        /// <summary>
        /// <para>Input Features</para>
        /// <para>The input point, line, or polygon features to be buffered.</para>
        /// <para>要缓冲的输入点、线或面要素。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_features { get; set; }


        /// <summary>
        /// <para>Output Feature Class</para>
        /// <para>The feature class containing the output buffers.</para>
        /// <para>包含输出缓冲区的要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Feature Class")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_feature_class { get; set; }


        /// <summary>
        /// <para>Distance [value or field]</para>
        /// <para><xdoc>
        ///   <para>The distance around the input features that will be buffered. Distances can be provided as either a value representing a linear distance or as a field from the input features that contains the distance to buffer each feature.</para>
        ///   <para>If linear units are not specified or are entered as Unknown, the linear unit of the input features' spatial reference is used.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将缓冲的输入要素周围的距离。距离既可以作为表示线性距离的值提供，也可以作为输入要素的字段提供，其中包含要缓冲每个要素的距离。</para>
        ///   <para>如果未指定线性单位或输入为未知，则使用输入要素空间参考的线性单位。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Distance [value or field]")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _buffer_distance_or_field { get; set; }


        /// <summary>
        /// <para>Dissolve Type</para>
        /// <para><xdoc>
        ///   <para>Specifies the type of dissolve operation to be performed to remove buffer overlap.</para>
        ///   <bulletList>
        ///     <bullet_item>No Dissolve—An individual buffer for each feature will be maintained, regardless of overlap. This is the default.</bullet_item><para/>
        ///     <bullet_item>Dissolve all output features into a single feature—All buffers will be dissolved together into a single feature, removing any overlap.</bullet_item><para/>
        ///     <bullet_item>Dissolve features using the listed fields' unique values or combination of values—Any buffers sharing attribute values in the listed fields (carried over from the input features) will be dissolved.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定为删除缓冲区重叠而要执行的溶解操作的类型。</para>
        ///   <bulletList>
        ///     <bullet_item>无融合 - 无论是否重叠，都将保留每个要素的单独缓冲区。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>将所有输出要素融合为单个要素 - 所有缓冲区将一起融合为单个要素，从而消除任何重叠。</bullet_item><para/>
        ///     <bullet_item>使用所列字段的唯一值或值组合来溶解要素 - 将溶解所列字段中共享属性值（从输入要素继承而来）的任何缓冲区。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Dissolve Type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _dissolve_option_value _dissolve_option { get; set; } = _dissolve_option_value._NONE;

        public enum _dissolve_option_value
        {
            /// <summary>
            /// <para>No Dissolve</para>
            /// <para>No Dissolve—An individual buffer for each feature will be maintained, regardless of overlap. This is the default.</para>
            /// <para>无融合 - 无论是否重叠，都将保留每个要素的单独缓冲区。这是默认设置。</para>
            /// </summary>
            [Description("No Dissolve")]
            [GPEnumValue("NONE")]
            _NONE,

            /// <summary>
            /// <para>Dissolve all output features into a single feature</para>
            /// <para>Dissolve all output features into a single feature—All buffers will be dissolved together into a single feature, removing any overlap.</para>
            /// <para>将所有输出要素融合为单个要素 - 所有缓冲区将一起融合为单个要素，从而消除任何重叠。</para>
            /// </summary>
            [Description("Dissolve all output features into a single feature")]
            [GPEnumValue("ALL")]
            _ALL,

            /// <summary>
            /// <para>Dissolve features using the listed fields' unique values or combination of values</para>
            /// <para>Dissolve features using the listed fields' unique values or combination of values—Any buffers sharing attribute values in the listed fields (carried over from the input features) will be dissolved.</para>
            /// <para>使用所列字段的唯一值或值组合来溶解要素 - 将溶解所列字段中共享属性值（从输入要素继承而来）的任何缓冲区。</para>
            /// </summary>
            [Description("Dissolve features using the listed fields' unique values or combination of values")]
            [GPEnumValue("LIST")]
            _LIST,

        }

        /// <summary>
        /// <para>Dissolve Field(s)</para>
        /// <para><xdoc>
        ///   <para>The list of fields from the input features on which the output buffers will be dissolved. Any buffers sharing attribute values in the listed fields (carried over from the input features) will be dissolved.</para>
        ///   <para>The Add Field button, which is only used in ModelBuilder, allows you to add expected fields to the Dissolve Field(s) list.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输入要素中将在其上溶解输出缓冲区的字段列表。将解散所有字段中共享属性值的任何缓冲区（从输入要素继承而来）。</para>
        ///   <para>添加字段按钮（仅在模型构建器中使用）可用于将预期字段添加到“融合字段”列表中。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Dissolve Field(s)")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _dissolve_field { get; set; } = null;


        /// <summary>
        /// <para>Method</para>
        /// <para><xdoc>
        ///   <para>Specifies the method to use, planar or geodesic, to create the buffer.</para>
        ///   <bulletList>
        ///     <bullet_item>Planar—If the input features are in a projected coordinate system, Euclidean buffers will be created. If the input features are in a geographic coordinate system and the buffer distance is in linear units (meters, feet, and so forth, as opposed to angular units such as degrees), geodesic buffers will be created. This is the default. You can use the Output Coordinate System environment setting to specify the coordinate system to use. For example, if your input features are in a projected coordinate system, you can set the environment to a geographic coordinate system to create geodesic buffers.</bullet_item><para/>
        ///     <bullet_item>Geodesic (shape preserving)—All buffers will be created using a shape-preserving geodesic buffer method, regardless of the input coordinate system.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定用于创建缓冲区的方法（平面或测地线）。</para>
        ///   <bulletList>
        ///     <bullet_item>平面 - 如果输入要素位于投影坐标系中，则将创建欧几里得缓冲区。如果输入要素位于地理坐标系中，并且缓冲区距离采用线性单位（米、英尺等，而不是角度单位（如度），则将创建测地线缓冲区。这是默认设置。可以使用输出坐标系环境设置来指定要使用的坐标系。例如，如果输入要素位于投影坐标系中，则可以将环境设置为地理坐标系以创建测地线缓冲区。</bullet_item><para/>
        ///     <bullet_item>测地线（形状保留）—无论输入坐标系如何，都将使用形状保留测地线缓冲区方法创建所有缓冲区。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Method")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _method_value _method { get; set; } = _method_value._PLANAR;

        public enum _method_value
        {
            /// <summary>
            /// <para>Geodesic (shape preserving)</para>
            /// <para>Geodesic (shape preserving)—All buffers will be created using a shape-preserving geodesic buffer method, regardless of the input coordinate system.</para>
            /// <para>测地线（形状保留）—无论输入坐标系如何，都将使用形状保留测地线缓冲区方法创建所有缓冲区。</para>
            /// </summary>
            [Description("Geodesic (shape preserving)")]
            [GPEnumValue("GEODESIC")]
            _GEODESIC,

            /// <summary>
            /// <para>Planar</para>
            /// <para>Planar—If the input features are in a projected coordinate system, Euclidean buffers will be created. If the input features are in a geographic coordinate system and the buffer distance is in linear units (meters, feet, and so forth, as opposed to angular units such as degrees), geodesic buffers will be created. This is the default. You can use the Output Coordinate System environment setting to specify the coordinate system to use. For example, if your input features are in a projected coordinate system, you can set the environment to a geographic coordinate system to create geodesic buffers.</para>
            /// <para>平面 - 如果输入要素位于投影坐标系中，则将创建欧几里得缓冲区。如果输入要素位于地理坐标系中，并且缓冲区距离采用线性单位（米、英尺等，而不是角度单位（如度），则将创建测地线缓冲区。这是默认设置。可以使用输出坐标系环境设置来指定要使用的坐标系。例如，如果输入要素位于投影坐标系中，则可以将环境设置为地理坐标系以创建测地线缓冲区。</para>
            /// </summary>
            [Description("Planar")]
            [GPEnumValue("PLANAR")]
            _PLANAR,

        }

        /// <summary>
        /// <para>Maximum Offset Deviation</para>
        /// <para><xdoc>
        ///   <para>The maximum distance the resulting output buffer polygon boundary will deviate from the true buffer boundary.</para>
        ///   <para>The true buffer boundary is a curve. However, the resulting polygon boundary is a densified polyline. Using this parameter, you can control how the output polygon boundary approximates the true buffer boundary.</para>
        ///   <para>If this parameter is not set or is set to 0, the tool will identify the maximum deviation. It is recommended that you use the default value. Performance degradation (in the tool and in subsequent analyses) may result from using a maximum offset deviation that is too small.</para>
        ///   <para>See the Maximum Offset Deviation parameter information in the Densify tool documentation for details.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>生成的输出缓冲区多边形边界将偏离真实缓冲区边界的最大距离。</para>
        ///   <para>真正的缓冲边界是一条曲线。但是，生成的多边形边界是致密的折线。使用此参数，您可以控制输出面边界如何逼近真实缓冲区边界。</para>
        ///   <para>如果未设置此参数或将其设置为 0，则工具将识别最大偏差。建议您使用默认值。性能下降（在工具和后续分析中）可能是由于使用过小的最大偏移偏差造成的。</para>
        ///   <para>有关详细信息，请参阅 Densify 工具文档中的最大偏移偏差参数信息。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Maximum Offset Deviation")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public string _max_deviation { get; set; } = "0 Unknown";


        public PairwiseBuffer SetEnv(object MDomain = null, object MResolution = null, object MTolerance = null, object XYDomain = null, object XYResolution = null, object XYTolerance = null, object ZDomain = null, object ZResolution = null, object ZTolerance = null, object extent = null, object geographicTransformations = null, object outputCoordinateSystem = null, object outputMFlag = null, object outputZFlag = null, object outputZValue = null, object parallelProcessingFactor = null, object scratchWorkspace = null, object workspace = null)
        {
            base.SetEnv(MDomain: MDomain, MResolution: MResolution, MTolerance: MTolerance, XYDomain: XYDomain, XYResolution: XYResolution, XYTolerance: XYTolerance, ZDomain: ZDomain, ZResolution: ZResolution, ZTolerance: ZTolerance, extent: extent, geographicTransformations: geographicTransformations, outputCoordinateSystem: outputCoordinateSystem, outputMFlag: outputMFlag, outputZFlag: outputZFlag, outputZValue: outputZValue, parallelProcessingFactor: parallelProcessingFactor, scratchWorkspace: scratchWorkspace, workspace: workspace);
            return this;
        }

    }

}